package com.ouroboroswiki.web;

import java.util.Map;

import com.ouroboroswiki.core.Content;
import com.ouroboroswiki.core.ContentException;
import com.ouroboroswiki.core.ContentPath;
import com.ouroboroswiki.core.ContentRepository;

public class ContentRepositoryContentSource implements ContentSource {

	private ContentRepository contentRepository;
	
	public ContentRepositoryContentSource( ContentRepository contentRepository ) {
		this.contentRepository = contentRepository;
	}
	
	@Override
	@SuppressWarnings("unchecked")
	public Content getContent(Object principal, Object parameter, ContentPath path, Map parameters) throws ContentException {
		return contentRepository.getContent(principal, path, null, parameters);
	}

}
